<?php

class BaseController extends Controller {

    public function __construct()
    {
        $this->beforeFilter('csrf', array('on' => 'post'));

        View::composer(array( '*' ), function ($view){

            if(Session::has('message')){
                $view->with('message', Session::get('message' , '' ) );
            }
            $view->with('locale', Session::get('locale' , '' ) );
        });
    }

	protected function setupLayout()
	{
		if ( ! is_null($this->layout))
		{
			$this->layout = View::make($this->layout);
		}
	}

}